﻿using Hrm.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hrm.Services
{
    public interface IBaseService<T> where T : Entity
    {
        T GetById(object id);

        T Get(Func<T, bool> predicate);

        IEnumerable<T> GetAll();

        IEnumerable<T> GetList(Func<T, bool> predicate);

        IQueryable<T> GetAllAbledAndOrderByCreatetime();

        IQueryable<T> GetListAbledAndOrderByCreatetime(Func<T, bool> predicate);

        int Insert(T entity);

        void Insert(IEnumerable<T> entities);

        int Update(T entity);

        void Update(IEnumerable<T> entities);

        int UpdateDisabled(T entity);

        void UpdateDisabled(IEnumerable<T> entities);

        int Delete(object id);

        int Delete(T entity);

        void Delete(IEnumerable<T> entities);
    }
}
